@use '@scss/common' as *;

.caseStudyCards {
  position: relative;
}

.cards {
  position: relative;
  padding: 4rem 0;

  @include mid-break {
    padding: 2rem 0;
  }
}

.gutter {
  position: relative;
}

.scanline {
  --margin: min(calc(var(--gutter-h) / 2), 4rem);
  margin-left: var(--margin);
  margin-right: var(--margin);
  width: calc(100% - var(--margin) * 2);

  @include mid-break {
    --margin: auto;
    width: 100%;
  }
}

.card {
  position: relative;
  border: 1px solid var(--grid-line-dark);
  display: flex;
  text-decoration: none;
  background-color: var(--theme-bg);
  transition: border 200ms ease-out;

  @include data-theme-selector('dark') {
    border-color: var(--grid-line-dark);
  }

  @include data-theme-selector('light') {
    border-color: var(--grid-line-light);
  }

  &:not(:last-child) {
    margin-bottom: 2rem;
  }

  &:hover {
    border: 1px solid var(--theme-text);
    .media {
      img {
        transform: scale(1.05) rotate(-1deg);
      }
      &:after {
        opacity: 0.5;
      }
    }
  }

  @include small-break {
    flex-direction: column;
  }
}

.content {
  padding: 4rem 3rem;
  width: auto;
  flex-shrink: 0;
  flex: 1;

  @include large-break {
    padding: 3rem 1.5rem;
  }

  @include small-break {
    padding: 1.5rem 1rem;
  }

  * {
    margin-top: 0;
  }
}

.media {
  position: relative;
  width: 50%;
  flex-shrink: 0;
  min-height: 150px;
  overflow: hidden;

  &:after {
    content: '';
    position: absolute;
    height: 100%;
    width: 100%;
    background-color: var(--theme-elevation-700);
    opacity: 0;
    mix-blend-mode: hard-light;
    transition: opacity 0.25s ease;
  }

  img {
    object-fit: cover;
    transition: 300ms ease transform;
  }

  @include small-break {
    width: 100%;

    &:after {
      display: none;
    }
  }
}

.bg {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% + var(--gutter-h));
  height: 100%;
  margin-left: calc(var(--gutter-h) / -2);

  @include mid-break {
    margin-left: calc(var(--gutter-h) * -1);
    width: calc(100% + (var(--gutter-h) * 2));
  }
}
